<?php
/**
 * The Ajax file.
 *
 * Used to respond to ajax requests
 *
 * @package WordPress
 * @subpackage Amawal
 */

error_reporting(E_ALL ^ E_DEPRECATED);

require_once('../../../wp-config.php');

// Is there a posted query string?
if(isset($_POST['action']))  
{
	global $wpdb;
	//$wpdb->show_errors();
	
	switch ($_POST['action']){
		
		case 'contact' : // update ad data in the ad page.
		
			if( amawal_mail() )
				echo json_encode( array('status' => 'success') );
			else
				echo json_encode( array('status' => 'error') );
			
		break;
		
	}
	
} else 
{
	//wp_redirect( get_option('siteurl') );
	exit();
}
?>